<?php
class ModelCatalogAccountRight extends Model {

	public function editItem($flag,$item_id,$num) {
		if($flag=="logged"){
		    $this->db->query("UPDATE " . DB_PREFIX . "module_right SET logged = '" . (int)$num . "' WHERE item_id = '" . (int)$item_id . "'");
	    }
	    if($flag=="nologged"){
	    	$this->db->query("UPDATE " . DB_PREFIX . "module_right SET nologged = '" . (int)$num . "' WHERE item_id = '" . (int)$item_id . "'");
	    }
	}
	
	public function getItems() {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "module_right ORDER BY item_id");
		return $query->rows;
	}	
}
?>
